<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta name="HandheldFriendly" content="true"/>
        <meta name="MobileOptimized" content="320"/>
        <title>H5Plugin</title>
        <link rel="stylesheet" href="css/mui.min.css" type="text/css" charset="utf-8"/>
        <script type="text/javascript" src="./js/bleplugin.js"></script>
        <script>
            function testx(data){
                if(data.status==0){
                    
                }else if(data.status==2){
                    
                }
            }
        
        function bluetoothCallBack(data){
            document.getElementById("box").innerHTML += JSON.stringify(data)+"<br />";
        }
        
        
        document.addEventListener('plusready',function(){
                                  // Android
                                  
                                  },false);
                                  
                                  function pluginShow() {
                                      plus.channel.PluginTestFunction("Html5","Plus","AsyncFunction","MultiArgument!", function( result ) {alert( result[0]  + "_" + result[1]  + "_" + result[2]  + "_" + result[3] );},function(result){alert(result)});
                                  }
        
        
        
        
        
        function searchBluetooth(){
            plus.bluetooth.search("搜索蓝牙",function( result ){
                                  alert(result);
                                  },function(result){alert(result)});
        }
        
        
        function closeBluetooth(){
            plus.bluetooth.close("关闭蓝牙");
        }
        function cancelBluetooth(){
            plus.bluetooth.cancelBLE("断开蓝牙");
        }
        function boundBluetooth(){
            alert("8B2878B2-5C30-4570-A4C7-22B76A20593B");
            plus.bluetooth.bound(["C129ADF1-E332-49E8-A527-572E9512961F","LPK130M_E590"]);
        }
      

        
        
            </script>
        <link rel="stylesheet" href="./css/common.css" type="text/css" charset="utf-8"/>
    </head>
    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title" id="mui-title" v-text="hear">蓝牙调试</h1>
        </header>
        <div id="consoleTest"></div>
        <div id="dcontent" class="dcontent">
            <br/>
            <div class="button" onclick="searchBluetooth()">搜索蓝牙</div>
            <div class="button" onclick="closeBluetooth()">停止</div>
<!--            <div class="button" onclick="cancelBluetooth()">断开蓝牙</div>-->
<!--            <div class="button" onclick="boundBluetooth()">绑定蓝牙</div>-->

            <br/>
            <div id="box"></div>
        </div>
        
    </body>
</html>
